<template>
	<view>
		<cu-custom bgColor="bg-white">
			<block slot="content">文章分类</block>
		</cu-custom>
		<scroll-view scroll-y class="page bg-white">
			<view class="cu-card bg-white">
				<view class="cu-item bg-img shadow-warp" style="background-image:url(https://tuku.ycygame.cn/anhaowu/wdh2236.jpg)" @click="goCategorieslist"
				 :data-mid="item.mid" v-for="(item,index) in categories" :key="index" v-if="index>0">
					<view class="cardTitle" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]">
						{{item.name}}
					</view>
				</view>
			</view>
			
		</scroll-view>
	</view>
</template>

<script>
	var API = require('../../utils/api');
	var Net = require('../../utils/net');

	export default {
		data() {
			return {
				StatusBar: this.StatusBar,
				CustomBar: this.CustomBar,
				categories: [],
			};
		},
		onLoad(res) {
			this.getCat()
		},
		methods: {
			getCat: function() {
				var that = this;
				Net.request({
					url: API.GetCat(),
					success: function(res) {
						that.categories = res.data.data
						console.log(that.categories)
					}
				})
			},
			goCategorieslist: function(e) {
				uni.navigateTo({
					url: "/pages/categorieslist/categorieslist?mid=" + e.currentTarget.dataset.mid
				})
			},
		}
	}
</script>

<style>
	.page {
		height: 100vh;
	}

	.cardTitle {
		color: #fff;
		padding: 90upx 60upx;
		font-size: 40upx;
		font-weight: 300;
		transform: skew(-10deg, 0deg);
		position: relative;
		text-shadow: 0px 0px 6upx rgba(0, 0, 0, 0.3)
	}

	.cardTitle::before {
		content: "";
		position: absolute;
		width: 60upx;
		height: 6upx;
		border-radius: 20upx;
		background-color: #fff;
		display: block;
		top: 60upx;
		left: 50upx;
		transform: skew(10deg, 0deg);
	}

	.cardTitle::after {
		content: "";
		position: absolute;
		width: 140upx;
		border-radius: 6upx;
		height: 24upx;
		background-color: #fff;
		display: block;
		bottom: 76upx;
		left: 90upx;
		transform: skew(10deg, 0deg);
		opacity: 0.1;
	}
</style>
